unit RilTools;

interface

uses Classes, Ril, Controls;

type
  Stream = class(TObject)
  public
    class function GetStream(AStream: TStream; AOwned: Boolean = True): IStream;
  end;

  Control = class(TObject)
  public
    class function Component(AComponent: TComponent): IComponent;
    class function Control(AControl: TControl): IControl;
    class function WinControl(AWinControl: TWinControl): IWinControl;
  end;

implementation

uses
  RilLmStream, RilLmClasses, RilLmControls;

class function Stream.GetStream(AStream: TStream; AOwned: Boolean = True):
  IStream;
begin
  Result := RilLmStream.TRilStream.Create(AStream, AOwned);
end;

class function Control.Component(AComponent: TComponent): IComponent;
begin
  Result := RilLmClasses.TRilComponent.Create(AComponent);
end;

class function Control.Control(AControl: TControl): IControl;
begin
  Result := RilLmControls.TRilControl.Create(AControl);
end;

class function Control.WinControl(AWinControl: TWinControl): IWinControl;
begin
  Result := RilLmControls.TRilWinControl.Create(AWinControl);
end;

end.

